home *** CD-ROM | disk | FTP | other *** search
/ Chip 1996 November / Chip 11-96.iso / treiber / drucker / lexmark / optrae / windows / optraewi.exe / LINMV.ZIP / MV.LIN
INI File  |  1995-06-30  |  16KB  |  488 lines

  1. [Variables]
  2. ;
  3. ; >>>
  4. ; >>> BEGINNING OF NLS -- Start translating here.
  5. ; >>>
  6. ; >>> Do not translate the variable name on the left, only translate the
  7. ; >>> quoted string.
  8. ; >>>
  9. ;
  10. $APPNAME = "MarkVision Installation"
  11. $FINALMSG = "Congratulations!  MarkVision has been successfully installed."
  12.  
  13. $Str_MarkVision = "MarkVision Printer Utility"
  14. $Str_MarkVision_Remote = "MarkVision (running from server)"
  15.  
  16. $Str_MarkVision_Misc = "Printer Utility Support Files"
  17. $Str_Sounds = "Printer Utility Sound Files"
  18. $Str_SpeakerDriver = "PC Speaker Driver"
  19.  
  20. $Str_DefaultMarkVisionGroup = "MarkVision Printer Utility"
  21. $Str_ItemName_ReadMe = "Optra E Read Me"
  22. $Str_ItemName_Support = "Lexmark Support"
  23.  
  24. $Str_Prompt_ChooseDir = "We recommend installing MarkVision into its own directory.  Please enter a path in the field to the right."
  25. $Str_Prompt_ProgmanTitle = "Create Program Manager Item"
  26. $Str_Prompt_ProgmanMsg = "To create a new Program Manager item for MarkVision, choose a group name and item name below and press the <OK> button."
  27. $Str_Prompt_AutoMarkVision = "Do you want to launch MarkVision each time you start Windows?"
  28. $Str_Prompt_SoundDriver = "Installing sound driver for your PC speaker..."
  29. $Str_Prompt_No386Enh = "Before running the printer utility, you must be in Windows 386 Enhanced mode.  The utility will still be installed."
  30.  
  31. $Str_Disk_Setup = "Windows Setup Diskette"
  32. $Str_Disk_Driver = "Windows Setup Diskette"
  33.  
  34. $Str_Desc_LexpanelINI = "MarkVision settings file"
  35.  
  36. ; >>>
  37. ; >>> END OF NLS -- Stop translating here
  38. ; >>>
  39.  
  40. ;
  41. ; System variables...
  42. ;
  43. $APPDIR = ""
  44. $READMEFILE = "rdme4026.txt"
  45. $SUPPORTFILE = "software.txt"
  46. $INSTALLMETHODS = "E"
  47. $INSTALLMODE = "E"
  48. $INSTALLMACRO = "InstallRemoteMarkVision"
  49. $SIZECOMPONENT = "MarkVision"
  50. $MINTEMPSPACE = "500"
  51.  
  52. ;
  53. ; Switches that toggle installation of the different components.
  54. ; Network administrators may override these in an extra config file
  55. ; to tailor for their own environment.
  56. ;
  57. $Install_MarkVision = $YES
  58. $Install_ProgmanGroup = $YES
  59. $Install_StartupGroup = ""
  60. $StartUpGroupName = "StartUp"
  61. $Install_RemoteMV = $NO
  62.  
  63.  
  64. ;
  65. ; INI files
  66. ;
  67. $LexpanelINI = $APPDIR
  68. $LexIniCfgSec = "config"
  69. $LexIniDefMdlCls = "5"
  70.  
  71.  
  72. ;
  73. ; Other globals...
  74. ;
  75. $RemoteMarkVisionDir = ""                    ; $SERVERDIR + $DirName_RemoteMV
  76. $UserMVGroup = $Str_DefaultMarkVisionGroup
  77.  
  78.  
  79. ;
  80. ; String constants
  81. ;
  82. $Exe_MarkVision = "lexpanel.exe"
  83. $Str_INI_Updated = "updated"
  84. $Str_DefaultMVDir = "\\markvis"
  85. $DirName_RemoteMV = "mv.w16"
  86.  
  87.  
  88. ;
  89. ; This stores the name of MarkVision as entered by the user
  90. ;
  91. $UserMVName = $Str_MarkVision
  92.  
  93.  
  94. ;
  95. ; Temporary strings
  96. ;
  97. $TempString = ""
  98. $TempAppDir = ""
  99. $TempServerAppDir = ""
  100.  
  101.  
  102.  
  103. [Disks]
  104.  
  105. MVSetupDisk = $Str_Disk_Setup, setupdsk.bmp, 255, 0, 0
  106. MVDrvDisk = $Str_Disk_Driver, drvdisk.bmp, 255, 0, 0
  107.  
  108.  
  109.  
  110. [Libraries]
  111.  
  112. MVUtility = linutil.dll
  113.  
  114.  
  115.  
  116. [Banners]
  117.  
  118. MarkVisionBanner = markvisn.bmp
  119.  
  120.  
  121.  
  122. [Components]
  123.  
  124. ; Normal installation components -- for remotely runnable MarkVision,
  125. ; $APPDIR will be $RemoteMarkVisionDir
  126.  
  127. Sounds = $Str_Sounds, , $APPDIR, MVSetupDisk, 250,
  128.             (wavcpef.zip, wavcpf.zip, wavcpjf.zip, wavdff.zip, wavmff.zip,
  129.           wavobff.zip, wavpnuif.zip, wavrpsf.zip, wavspf.zip, wavtcof.zip,
  130.           wavtyf.zip, wavlpef.zip, wavcdcf.zip, wavrtcf.zip, wavfff.zip)
  131.  
  132. MarkVision = $Str_MarkVision, MarkVisionBanner, $APPDIR, MVSetupDisk, 2100,
  133.                     (exepanel.zip, hlppanel.zip, dllsunfl.zip, pss.zip,
  134.                =rdme4026.txt, =software.txt, psfsunfl.zip, dlltab11.zip,
  135.                dllgenfn.zip, dllqmgmt.zip, Sounds)
  136.  
  137. SpeakerDrv = $Str_SpeakerDriver, , $SYSTEMDIR, MVSetupDisk, 15, drvspeak.zip
  138.  
  139. MVIni = $Str_Desc_LexpanelINI, , $TEMPDIR, MVSetupDisk, 1, inipanel.zip
  140.  
  141.  
  142. ; Server installation components
  143.  
  144. Sounds_Server = $Str_Sounds, , $SERVERAPPDIR, MVSetupDisk, 150,
  145.             (wavcpef.zip, wavcpf.zip, wavcpjf.zip, wavdff.zip, wavmff.zip,
  146.           wavobff.zip, wavpnuif.zip, wavrpsf.zip, wavspf.zip, wavtcof.zip,
  147.           wavtyf.zip, wavlpef.zip, wavcdcf.zip, wavrtcf.zip, wavfff.zip)
  148.  
  149. MarkVision_Server = $Str_Markvision, , $SERVERAPPDIR, MVSetupDisk, 371,
  150.             (exepanel.zip, hlppanel.zip, dllsunfl.zip, dlltab11.zip,
  151.          dllgenfn.zip, dllqmgmt.zip, drvspeak.zip, pss.zip, psfsunfl.zip,
  152.          =mv.lin, =markvisn.bmp, =rdme4026.txt, =software.txt,
  153.          Sounds_Server, MVIni_Server)
  154.  
  155. MVIni_Server = $Str_Desc_LexpanelINI, , $SERVERAPPDIR, MVSetupDisk,
  156.                         1, inipanel.zip
  157.  
  158.  
  159. ; Components for creating the remote MV server dir
  160.  
  161. RemoteMV_Misc_Server = $Str_MarkVision_Remote, , $DirName_RemoteMV,
  162.         MVDrvDisk, 65, (=mv.lin, =vxd.lin, =help.lin, =util.lin, =linutil.dll,
  163.         =shelldde.dll, =markvisn.bmp, =ctl3d.dll, drvspeak.zip)
  164.  
  165. RemoteMV_Misc_Remote = $Str_MarkVision_Remote, , $APPDIR, MVDrvDisk,
  166.                         155, (dllbwcc.zip, inipanel.zip)
  167.  
  168. RemoteMV_Server_Size = "", , , , 1, (RemoteMV_Misc_Server,
  169.                         RemoteMV_Misc_Remote, MarkVision)
  170.  
  171.  
  172.  
  173.  
  174. [ServerProducts]
  175.  
  176. RemoteMV_Misc_Server = "P"
  177.  
  178.  
  179.  
  180.  
  181. [Macros]
  182.  
  183. ; InstallProgmanGroup:    Creates a Program Manager group for MarkVision.
  184. ;                                Return value is empty (we use the return value
  185. ;                                for a temporary string.)
  186. ;
  187. InstallProgmanGroup()
  188.     (
  189.     ; Build the full pathname to lexpanel.exe
  190.     MakePathName($InstallProgmanGroup, , $APPDIR, $Exe_MarkVision)
  191.  
  192.     ; When in Express mode, do not even ask them whether they want to
  193.     ; create a program manager item...
  194.     ; $UserMVName holds the name of the MarkVision program, and is
  195.     ; modified by whatever the user enters.
  196.     IfEqual($INSTALLMODE, "E",
  197.         CallLibrary(MVUtility, CreateProgmanItem, $UserMVName,
  198.                         ($Str_DefaultMarkVisionGroup, $UserMVName,
  199.                         $InstallProgmanGroup, $NO)),
  200.         CallLibrary(MVUtility, CreateProgmanItem, $UserMVName,
  201.                         ($Str_DefaultMarkVisionGroup, $UserMVName,
  202.                         $InstallProgmanGroup, $NO, $Str_Prompt_ProgmanTitle,
  203.                         $Str_Prompt_ProgmanMsg, $HelpID_MVCreateItem,
  204.                   "$UserMVGroup")))
  205.  
  206.  
  207.     ; Add MarkVision to the StartUp group?
  208.     IfEqual($Install_StartupGroup, "",
  209.         ChooseYesNo($Install_StartupGroup, $Str_Prompt_AutoMarkVision, $YES,
  210.                         $HelpID_MVStartUpGroup))
  211.  
  212.     ; Use the same name entered by the user above.  Or, if they skipped it,
  213.     ; use the default name...
  214.    ; grw:950320 - If 'skip'ped, '$UserMVName' is unchanged
  215.     ;IfEqual($UserMVGroup, "", SetVariable($UserMVName, $Str_MarkVision))
  216.  
  217.     ; Create the item in the StartUp group
  218.     IfEqual($Install_StartupGroup, $YES,
  219.         CallLibrary(MVUtility, CreateProgmanItem, , ($StartUpGroupName,
  220.             $UserMVName, $InstallProgmanGroup, $YES)))
  221.  
  222.  
  223.    ; Add textfile 'items' to MV group if there is an MV group,
  224.    ;     or if MV is added to the 'startup' group
  225.    IfEqual($UserMVGroup, "", IfEqual($Install_StartupGroup, $YES,
  226.          CallMacro(InstallTextIcons, , $Str_DefaultMarkVisionGroup)),
  227.       CallMacro(InstallTextIcons, , $UserMVGroup))
  228.     )
  229.  
  230.  
  231.  
  232. ; CustomDirectory:    Called from "Custom Installation" window when user
  233. ;                            presses the <Directories> button.
  234. ;
  235. CustomDirectory()
  236.     (
  237.     ; Pick an installation directory
  238.     ChoosePath($APPDIR, $Str_Prompt_ChooseDir, $APPDIR,
  239.                     $HelpID_ChooseMarkVisionDir)
  240.  
  241.    CallMacro(UpdateNetDirectory, , )
  242.     )
  243.  
  244.  
  245.  
  246. ; InstallMarkVision:    Install MarkVision files
  247. ;                            Return value ignored (we use the return value as
  248. ;                            a temporary string.)
  249. ;
  250. InstallMarkVision()
  251.     (
  252.     ; Warn the user when they cannot run MarkVision
  253.     CallLibrary(MVUtility, In386Enh, $InstallMarkVision, )
  254.     IfEqual($InstallMarkVision, "N", ShowPopupMessage($Str_Prompt_No386Enh))
  255.  
  256.     ; For remote MarkVision, temporarily set the directories to
  257.     ; reference our new MarkVision dir
  258.     MakePathName($RemoteMarkVisionDir, , $SERVERDIR, $DirName_RemoteMV)
  259.     SetVariable($TempAppDir, $APPDIR)
  260.     SetVariable($TempServerAppDir, $SERVERAPPDIR)
  261.     IfEqual($INSTALLMODE, "S", SetVariable($APPDIR, $RemoteMarkVisionDir))
  262.     IfEqual($INSTALLMODE, "S", SetVariable($SERVERAPPDIR, $DirName_RemoteMV))
  263.  
  264.     ; For remote MarkVision, we need to install the component that will
  265.     ; create the product directory and update products.ini.  For normal
  266.     ; installations, we just make sure the directory exists.
  267.     IfEqual($INSTALLMODE, "S",
  268.         InstallComponent(RemoteMV_Misc_Server, , "S"),
  269.         CreatePath($APPDIR))
  270.  
  271.    ; For installing remote (runnable) MarkVision to a server, we need
  272.    ; some files unpacked into the $RemoteMarkVisionDir
  273.    IfEqual($INSTALLMODE, "S",
  274.       InstallComponent(RemoteMV_Misc_Remote, , "N"))
  275.  
  276.     ; Install MarkVision
  277.     InstallComponent(MarkVision, , "N")
  278.  
  279.     ; Make sure the VXD is installed
  280.     IfEqual($INSTALLMODE, "S",
  281.         InstallComponent(VXD_Server, , "S"),
  282.         CallMacro(InstallVXD, , ))
  283.  
  284.     ; Restore $APPDIR and $SERVERAPPDIR
  285.     SetVariable($APPDIR, $TempAppDir)
  286.     SetVariable($SERVERAPPDIR, $TempServerAppDir)
  287.  
  288.    ; We need to put our 'new' lexpanel.ini into $TEMPDIR, if not
  289.    ;     installing to server.
  290.    IfEqual($INSTALLMODE, "S", NOP(),
  291.        InstallComponent(MVIni))
  292.  
  293.     ; Finish up...
  294.     IfEqual($INSTALLMODE, "S",
  295.         CallMacro(FinishRemoteMVInstall, , ),
  296.         CallMacro(ConfigureMarkVision, , $APPDIR))
  297.    )
  298.  
  299.  
  300.  
  301. ; FinishRemoteMVInstall:    Performs remote installation duties not handled
  302. ;                                    by InstallMarkVision().
  303. ;
  304. FinishRemoteMVInstall()
  305.     (
  306.     ; Copy the remotemv.rsp file into the MarkVision dir as cmdline.rsp
  307.     MakePathName($FinishRemoteMVInstall, ,
  308.                        $RemoteMarkVisionDir, "cmdline.rsp")
  309.     MakePathName($TempString, , $SCRIPTDIR, "remotemv.rsp")
  310.     CopyFile($TempString, $FinishRemoteMVInstall)
  311.     )
  312.  
  313.  
  314.  
  315. ; ConfigureMarkVision:    Sets up INI files, etc..., so that the installed
  316. ;                                MarkVision is actually runnable.
  317. ;                                $IniFileDir points to the directory that holds the
  318. ;                                lexpanel.ini file.
  319. ;                       grw:950307 - Actually $IniFileDir points to where
  320. ;                       lexpanel.ini will be.  At this point, whether
  321. ;                       setting-up to run locally or from server,
  322. ;                       lexpanel.ini should be in $TEMPDIR
  323. ConfigureMarkVision($IniFileDir)
  324.     (
  325.     ; Set the $LexpanelINI variable to point to the MarkVision INI file
  326.     MakePathName($LexpanelINI, , $IniFileDir, "lexpanel.ini")
  327.     SetINI($WinINI, "MarkVision", "configuration", $LexpanelINI)
  328.  
  329.     ; Update the lexpanel.ini file
  330.    ; grw:950306 - '$IniFileDir' must be set correctly at this point,
  331.    ;                 as MergeINI depends upon it.
  332.    ; grw:950307 - Our new (or only) lexpanel.ini has just been installed
  333.    ;                 to '$TEMPDIR' at this point.
  334.     MakePathName($ConfigureMarkVision, , $TEMPDIR, "lexpanel.ini")
  335.     MergeINI($LexpanelINI, $ConfigureMarkVision)
  336.  
  337.    ; correct the 'eventcount' number under '[sounds]' in  lexpanel.ini .
  338.    CountINI($LexpanelINI, "sounds", "wav", $TempString)
  339.    SetINI($LexpanelINI, "sounds", "eventcount", $TempString)
  340.  
  341.     ; Tell other folks where MarkVision is
  342.     MakePathName($ConfigureMarkVision, , $APPDIR, $Exe_MarkVision)
  343.     SetINI($WININI, "MarkVision", "Exe", $ConfigureMarkVision)
  344.  
  345.     ; When this machine does not have a wave device, install the
  346.     ; PC-Speaker driver
  347.     GetINI($SystemINI, "drivers", "wave", $ConfigureMarkVision)
  348.     IfEqual($ConfigureMarkVision, "", CallMacro(InstallSoundDriver, , ))
  349.  
  350.     ; Tell MarkVision to check the server for product updates when it starts
  351.     SetINI($LexpanelINI, $LexIniCfgSec, "ServerCheck", "1")
  352.  
  353.    ; Make sure that 'npatrace' in lexpanel.ini is initially turned off
  354.    SetINI($LexpanelINI, $LexIniCfgSec, "npatrace", "0")
  355.  
  356.     ; Since 5/11/95, we need to set the 'defaultmodelclass' for each product.
  357.    SetINI($LexpanelINI, $LexIniCfgSec, "defaultmodelclass", $LexIniDefMdlCls)
  358.  
  359.     ; When installing under WinOS2, turn off enumeration of local ports
  360.     IfEqual($INWINOS2, "Y",
  361.         SetINI($WinINI, "MarkVision", "EnumLocalPorts", "0"))
  362.  
  363.     ; Make a Program Manager group?
  364.     IfEqual($Install_ProgmanGroup, "Y", CallMacro(InstallProgmanGroup, , ))
  365.  
  366.     ; In order for bi-di to work, we need to restart Windows
  367.     SetRebootFlag()
  368.     )
  369.  
  370.  
  371.  
  372. ; InstallSoundDriver:    Sets up the PC-Speaker sound driver.
  373. ;                                No return code.
  374. ;
  375. InstallSoundDriver()
  376.     (
  377.    InstallComponent(SpeakerDrv)
  378.  
  379.     ; Update system.ini
  380.     SetINI($SystemINI, "drivers", "wave", "speaker.drv")
  381.     )
  382.  
  383.  
  384.  
  385. ; ConfigureRemoteMarkVision:    Set up the local machine to run the
  386. ;                                        remote copy of MarkVision.
  387. ;
  388. ConfigureRemoteMarkVision()
  389.     (
  390.     ; Temporarily set $APPDIR to reference the remote MV dir.  Right now,
  391.     ; the $SCRIPTDIR is in the MarkVision remote directory...
  392.     SetVariable($TempAppDir, $APPDIR)
  393.     SetVariable($APPDIR, $SCRIPTDIR)
  394.  
  395.     ; Install the VXD on their local machine
  396.     CallMacro(InstallVXD, , )
  397.  
  398.     ; Copy lexpanel.ini from RemoteMVDir to '$TEMPDIR'
  399.     MakePathName($ConfigureRemoteMarkVision, , $TEMPDIR, "lexpanel.ini")
  400.     MakePathName($TempString, , $APPDIR, "lexpanel.ini")
  401.    CopyFile($TempString, $ConfigureRemoteMarkVision)
  402.  
  403.     ; Copy the [MarkVision]NetDll line from lexpanel.ini to win.ini
  404.    ; grw:950307 - if there is one
  405.     GetINI($ConfigureRemoteMarkVision, "MarkVision", "NetDLL", $TempString)
  406.    IfEqual($TempString, "", NOP(),
  407.        SetINI($WININI, "MarkVision", "NetDLL", $TempString))
  408.  
  409.     ; Now configure MarkVision as usual, except that the INI file is
  410.     ; in the Windows directory instead of in their MV directory
  411.     CallMacro(ConfigureMarkVision, , $WINDOWSDIR)
  412.  
  413.     ; Restore $APPDIR
  414.     SetVariable($APPDIR, $TempAppDir)
  415.     )
  416.  
  417.  
  418.  
  419. ; MakeDefaultAppDir:    This function sets $APPDIR to its default value.
  420. ;                            The return value is the drive from the $TEMPDIR variable.
  421. ;                 grw:950321 - This macro is called when we decide that MV
  422. ;                 has not been installed on this machine before.
  423. ;
  424. MakeDefaultAppDir()
  425.     (
  426.     ; Find the drive that stores this temporary directory
  427.     SplitPath($TEMPDIR, $MakeDefaultAppDir, , )
  428.  
  429.     ; Make a MarkVision directory on this drive
  430.     MakePathName($APPDIR, $MakeDefaultAppDir, $Str_DefaultMVDir, )
  431.     )
  432.  
  433.  
  434.  
  435. ;  MVPreRun:   grw:950323 - This is split out of 'Initialize()', for things
  436. ;                 which may need to be done multiple times in one session.
  437. ;
  438. MVPreRun()
  439.    (
  440.     ; When not in 386Enh mode, MarkVision cannot be executed, so disable the
  441.     ; install (for when they use 'Custom')
  442.    ; grw:950323 - This also disables installing MarkVision for 'express.'
  443.     CallLibrary(MVUtility, In386Enh, $MVPreRun, )
  444.     IfEqual($MVPreRun, $NO, SetVariable($Install_MarkVision, $NO))
  445.    )
  446.  
  447.  
  448.  
  449. ; Initialize:    Called before any other macros are run and before any
  450. ;                    GUI stuff is shown.
  451. ;                    The return value is meaningless (used as a temporary string.)
  452. ;
  453. Initialize()
  454.     (
  455.     ; Is MarkVision already installed somewhere?  Check for the
  456.    ; 'configuration=' entry under '[MarkVision]' in win.ini.
  457.     IfEqual($LexpanelINI, "",
  458.         GetINI($WinINI, "MarkVision", "configuration", $LexpanelINI))
  459.     IfEqual($LexpanelINI, "",
  460.         CallMacro(MakeDefaultAppDir, , ),
  461.         CallMacro(StripFilename, $APPDIR, ($LexpanelINI)))
  462.    ; grw:950321 - We need to do some more work for $APPDIR if '$LexpanelINI'
  463.    ;     is not blank, allowing for MV running from server.
  464.    IfEqual($APPDIR, $WINDOWSDIR, CallMacro(MakeDefaultAppDir, , ))
  465.  
  466.     ; Initialize some global variables
  467.     MakePathName($READMEVIEWER, , $WINDOWSDIR, "notepad.exe")
  468.  
  469.     ; Add lexpanel.ini to the list of settings files
  470.     SettingsFile("lexpanel.ini", $Str_Desc_LexpanelINI)
  471.  
  472.    CallMacro(MVPreRun, , )
  473.     )
  474.  
  475.  
  476.  
  477. ; Entry point when the script is run independently.
  478. ;
  479. InstallRemoteMarkVision($cmdline)
  480.     (
  481.     ; Pretend we are in "Custom" mode so the user is asked questions, like
  482.     ; how to name their mv icon
  483.     SetVariable($INSTALLMODE, "C")
  484.  
  485.     CallMacro(ConfigureRemoteMarkVision, , )
  486.     )
  487.  
  488.